package com.zjitc.controller;

import com.zjitc.model.Country;
import com.zjitc.service.CountryService;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/20 16:56
 * @description:
 */
@Controller
public class CountryController {

  @Autowired
  private CountryService countryService;

    @RequestMapping("/location")
    public ModelAndView handler(){
      List<Country> list = countryService.findAll();

      ModelAndView modelAndView = new ModelAndView();
    modelAndView.addObject("index",list);
    modelAndView.setViewName("/WEB-INF/index.jsp");
    return modelAndView;
  }
}
